#!/bin/bash
if [ $# -eq 0  ]; then
	echo "There is no parameter to start a daemon..."
	exit
fi

if [ $1 = "ReadTest" ]; then
	java -Djava.library.path=./lib/ -cp ./bin/TDFS2.jar tr.edu.ozyegin.ccrg.raid.test.ReadTest /dev/sdb
else
	if [ $1 = "RARTest" ]; then
		java -Djava.library.path=./lib/ -cp ./bin/TDFS2.jar tr.edu.ozyegin.ccrg.raid.test.RARTest /dev/sdb $2
	else
		if [ $1 = "StartMaster" ]; then
			java -Djava.library.path=./lib/ -cp ./bin/TDFS2.jar tr.edu.ozyegin.ccrg.raid.network.MasterTest
		else
			if [ $1 = "StartSlave" ]; then
				java -Djava.library.path=./lib/ -cp ./bin/TDFS2.jar tr.edu.ozyegin.ccrg.raid.network.SlaveTest
			else
				if [ $1 = "BlockSize" ]; then
                                	java -Djava.library.path=./lib/ -cp ./bin/TDFS2.jar tr.edu.ozyegin.ccrg.raid.test.BlockSizeTest /dev/sdb
				else
					if [ $1 = "Monitor" ]; then
                                        java -Djava.library.path=./lib/ -cp ./bin/TDFS2.jar tr.edu.ozyegin.ccrg.raid.test.SystemStat
	                                else

						echo "Wrong choice"
					fi
				fi
			fi
		fi
	fi
fi
